﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Code.Models
{
    public enum ChaseTaskState
    {
        /// <summary>
        /// 系统撤消
        /// </summary>
        SysCancel = -4,
        /// <summary>
        /// 中奖撤消
        /// </summary>
        WinCancel = -3,
        /// <summary>
        /// 过期撤消
        /// </summary>
        TimeOutCancel = -2,
        /// <summary>
        /// 用户撤消
        /// </summary>
        UserCancel = -1,
        /// <summary>
        /// 正常
        /// </summary>
        Normal = 0,
        /// <summary>
        /// 已执行
        /// </summary>
        Executed = 1,
    }


    public static class ChaseTaskStateEx
    {
        public static string GetName(this ChaseTaskState state)
        {
            switch (state)
            {
                case ChaseTaskState.SysCancel:
                    return "系统撤消";
                case ChaseTaskState.WinCancel:
                    return "中奖撤消";
                case ChaseTaskState.TimeOutCancel:
                    return "过期撤消";
                case ChaseTaskState.UserCancel:
                    return "用户撤消";
                case ChaseTaskState.Normal:
                    return "正在执行";
                case ChaseTaskState.Executed:
                    return "追号完成";
                default:
                    throw new ArgumentOutOfRangeException("state");
            }
        }
    }
}
